package org.example.springbook.service;

import org.example.springbook.mapper.UserMapper;
import org.example.springbook.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public UserInfo queryUserByName(String username) {
        //在控制层进行参数检验
        UserInfo userInfo = userMapper.queryUserByUserName(username);
        if(userInfo==null) {
            return null;
        }
        return userInfo;
    }
}
